<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

class Identify extends Model
{
    //
    use SoftDeletes;
    protected $primaryKey = 'id';

    protected $fillable = [
        'user_id',
        'identify_id',
        'video_id',
        'image_id',
        'is_red_packets',
        'red_packets_id',
        'status',
    ];

    protected $casts = [
        'is_red_packets' => 'boolean',
    ];

    public function image(){
        return $this->hasOne('\App\Models\IdentifyImage','id','identify_id');
    }

    public function getUser(){
        return $this->hasOne('\App\Models\Member','id','user_id');
    }


    public function getVideo(){
        return $this->hasOne('\App\Models\IdentifyVideo','id','video_id');
    }
}
